<html><head><title>VectorSourceImage</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">VectorSourceImage()</font></b></p>
<p><b>Syntax</b></p><blockquote>
<font color="#3A3966"><b>VectorSourceImage</b></font>(ImageID [, Alpha [, Width.d, Height.d [, Flags]]])</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Selects an image as the source for vector drawing operations 
such as <a href="fillpath.html">FillPath()</a> or <a href="strokepath.html">StrokePath()</a>. These functions will apply pixels from 
the specified image to the drawing output wherever they draw something. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>ImageID</i></td>
<td width="90%"> 
Specifies the image to use as the source. Use the <a href="../image/imageid.html">ImageID()</a> function to 
get this value from an image. 

</td></tr>
<tr><td><i>Alpha (optional)</i></td>
<td> 
Specifies an optional alpha transparency to apply to the source image. 
This transparency is applied in addition to any transparent pixels already 
present in the source image. 
The default is value is 255 (no additional transparency). 

</td></tr>
<tr><td><i>Width.d, Height.d (optional)</i></td>
<td> 
Specifies an optional with and height for the image. The values are interpreted 
in terms of the <font color="#924B72">#PB_Corrdinate_Source</font> coordinate system. If no width and height 
are specified, then the dimensions of the source image (in pixels) are converted 
into the unit of the vector drawing output and used (i.e. the image has its original 
size). 

</td></tr>
<tr><td><i>Flags (optional)</i></td>
<td> 
Can be one of the following values: 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_VectorImage_Default</font>: Areas outside of the source image are transparent (default)
  <font color="#924B72">#PB_VectorImage_Repeat</font> : The source image is repeated to cover the entire drawing area
</font></pre>

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>
None.


</blockquote><p><b>Remarks</b></p><blockquote>

See the <a href="index.html">vectordrawing overview</a> for an introduction to the different 
coordinate systems. 
<br>
<br>
By transforming the <font color="#924B72">#PB_Coordinate_Source</font> coordinate system, the used source 
image can be transformed (moved, rotated, stretched, skewed). See the second example below for a 
demonstration. 

</blockquote><p><b>Example:</b> Repeated source image</p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#3A3966">If</font></b> <font color="#3A3966">OpenWindow</font>(0, 0, 0, 400, 200, &quot;VectorDrawing&quot;, <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
<font color="#3A3966">    CanvasGadget</font>(0, 0, 0, 400, 200)
    
<font color="#3A3966">    LoadImage</font>(0, <font color="#924B72">#PB_Compiler_Home</font> + &quot;examples/Sources/Data/PureBasicLogo.bmp&quot;)

    <b><font color="#3A3966">If</font></b> <font color="#3A3966">StartVectorDrawing</font>(<font color="#3A3966">CanvasVectorOutput</font>(0))

<font color="#3A3966">      AddPathBox</font>(50, 50, 200, 50)
<font color="#3A3966">      AddPathBox</font>(150, 75, 200, 50)
      
<font color="#3A3966">      VectorSourceImage</font>(<font color="#3A3966">ImageID</font>(0), 255,<font color="#3A3966"> ImageWidth</font>(0),<font color="#3A3966"> ImageHeight</font>(0), <font color="#924B72">#PB_VectorImage_Repeat</font>)
<font color="#3A3966">      StrokePath</font>(20)
    
<font color="#3A3966">      StopVectorDrawing</font>()
    <b><font color="#3A3966">EndIf</font></b>
    
    <b><font color="#3A3966">Repeat</font></b>
      Event =<font color="#3A3966"> WaitWindowEvent</font>()
    <b><font color="#3A3966">Until</font></b> Event = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

<p><img src="../HelpPictures/vectorsourceimage.png"></p>

</blockquote><p><b>Example:</b> Rotated and flipped source image</p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#3A3966">If</font></b> <font color="#3A3966">OpenWindow</font>(0, 0, 0, 400, 200, &quot;VectorDrawing&quot;, <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
<font color="#3A3966">    CanvasGadget</font>(0, 0, 0, 400, 200)
    
<font color="#3A3966">    LoadImage</font>(0, <font color="#924B72">#PB_Compiler_Home</font> + &quot;examples/Sources/Data/PureBasicLogo.bmp&quot;)
<font color="#3A3966">    LoadFont</font>(0, &quot;Impact&quot;, 20, <font color="#924B72">#PB_Font_Bold</font>)    

    <b><font color="#3A3966">If</font></b> <font color="#3A3966">StartVectorDrawing</font>(<font color="#3A3966">CanvasVectorOutput</font>(0))
    
<font color="#3A3966">      FlipCoordinatesY</font>(50, <font color="#924B72">#PB_Coordinate_Source</font>)
<font color="#3A3966">      RotateCoordinates</font>(50, 50, -45, <font color="#924B72">#PB_Coordinate_Source</font>)      
<font color="#3A3966">      VectorSourceImage</font>(<font color="#3A3966">ImageID</font>(0), 255,<font color="#3A3966"> ImageWidth</font>(0),<font color="#3A3966"> ImageHeight</font>(0), <font color="#924B72">#PB_VectorImage_Repeat</font>)
      
<font color="#3A3966">      VectorFont</font>(<font color="#3A3966">FontID</font>(0), 150)
<font color="#3A3966">      MovePathCursor</font>(20, 20)      
<font color="#3A3966">      DrawVectorText</font>(&quot;TEXT&quot;)
    
<font color="#3A3966">      StopVectorDrawing</font>()
    <b><font color="#3A3966">EndIf</font></b>
    
    <b><font color="#3A3966">Repeat</font></b>
      Event =<font color="#3A3966"> WaitWindowEvent</font>()
    <b><font color="#3A3966">Until</font></b> Event = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

<p><img src="../HelpPictures/vectorsourceimage2.png"></p>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="vectorsourcecolor.html">VectorSourceColor()</a>, <a href="vectorsourcelineargradient.html">VectorSourceLinearGradient()</a>, <a href="vectorsourcecirculargradient.html">VectorSourceCircularGradient()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=vectorsourcegradientcolor.html>VectorSourceGradientColor()</a> - <a href="index.html">VectorDrawing Index</a> - <a href="vectorsourcelineargradient.html">VectorSourceLinearGradient()</a> -><br><br>


</body></html>